home *** CD-ROM | disk | FTP | other *** search
/ boe.pres.k12.wv.us / boe.pres.k12.wv.us.zip / boe.pres.k12.wv.us / Utilities / Xerox Workcentre 5335 / Windows Scan / 64-bit_x64 / Russian / cpsimage.cab / data / sys / transform2d.elf < prev    next >
Text File  |  2009-04-23  |  5KB  |  130 lines

  1. /*****************************************************************************/
  2. /*
  3. ** Module: TRANSFORM2D
  4. */
  5. /*****************************************************************************/
  6.  
  7. /*****************************************************************************/
  8. /*
  9. ** This class represents a rectangular window.
  10. */
  11. /*****************************************************************************/
  12. private
  13. CLASS WINDOW {
  14.    DOUBLE x;
  15.    DOUBLE y;
  16.    DOUBLE width;
  17.    DOUBLE height;
  18. }
  19.  
  20. /*****************************************************************************/
  21. /*
  22. ** This class represents a 3 x 3 affine transformation matrix decomposition.
  23. **
  24. ** The matrix decomposition of any non-degenerate 3 x 3 affine transformation
  25. ** matrix can be expressed as the following sequence of transformations
  26. **
  27. **   S(sx, sy) * SH(shx, 0) * R(ang) * T(tx, ty)
  28. */
  29. /*****************************************************************************/
  30. private
  31. CLASS TRANSFORM2DPARTS {
  32.    DOUBLE tx;
  33.    DOUBLE ty;
  34.    DOUBLE sx;
  35.    DOUBLE sy;
  36.    DOUBLE shx;
  37.    DOUBLE angle;
  38. }
  39.  
  40. /*****************************************************************************/
  41. /* @New
  42. // DESCRIPTION
  43.    This class represents a 3 x 3 affine transformation matrix.
  44.   
  45.    A general transformation matrix is expressed as
  46.   
  47.      [ a b 0 ]
  48.      [ c d 0 ]
  49.      [ e f 1 ]
  50.   
  51.    The concatenation of two transforms in matrix form is:
  52.   
  53.      [ a1 b1 0 ]   [ a2 b2 0 ]   [ a1*a2+b1*c2    a1*b2+b1*d2    0 ]
  54.      [ c1 d1 0 ] X [ c2 d2 0 ] = [ c1*a2+d1*c2    c1*b2+d1*d2    0 ]
  55.      [ e1 f1 1 ]   [ e2 f2 1 ]   [ e1*a2+f1*c2+e2 e1*b2+f1*d2+f2 1 ]
  56.   
  57.    It is primarily used in support of the Affine script procedure.
  58. */
  59. /* @applyToWin Applies this transform to input window. */
  60. /* @concatenate Concatenates the input transform to this transform. */
  61. /* @decompose Decomposes non-degenerate transform into standard operations. */
  62. /* @determinant Returns the determinant of this transform. */
  63. /* @getCoeffs Gets coefficients of this transform. */
  64. /* @identity Sets this transform to the identity. */
  65. /* @invert Sets this transform to its inverse. */
  66. /* @isIdentity Tests if this transform is the identity. */
  67. /* @parse Parses a transform from a string representation. */
  68. /* @preconcatenate Concatenates this transform to the input transform. */
  69. /* @rotate Concatenates a rotation transform onto this transform. */
  70. /* @scale Concatenates a scale transform onto this transform. */
  71. /* @set Sets this transform to the input transform. */
  72. /* @setCoeffs Sets coefficients of this transform. */
  73. /* @shear Concatenates a shear transform onto this transform. */
  74. /* @toString Returns a string representation of this transform. */
  75. /* @translate Concatenates a translation transform onto this transform. */
  76. /*****************************************************************************/
  77. private
  78. CLASS TRANSFORM2D {
  79.    // Methods
  80.    METHOD New () RETURNS (TRANSFORM2D t) NATIVE "Transform2DMethods@xipsup";
  81.  
  82.    METHOD Free () NATIVE "Transform2DMethods@xipsup";
  83.  
  84.    METHOD set (TRANSFORM2D other) NATIVE "Transform2DMethods@xipsup";
  85.  
  86.    METHOD identity () NATIVE "Transform2DMethods@xipsup";
  87.  
  88.    METHOD translate (DOUBLE tx, DOUBLE ty) NATIVE "Transform2DMethods@xipsup";
  89.  
  90.    METHOD scale (DOUBLE sx, DOUBLE sy) NATIVE "Transform2DMethods@xipsup";
  91.  
  92.    METHOD rotate (DOUBLE angle, DOUBLE fx, DOUBLE fy)
  93.      NATIVE "Transform2DMethods@xipsup";
  94.  
  95.    METHOD shear (DOUBLE shx, DOUBLE shy) NATIVE "Transform2DMethods@xipsup";
  96.  
  97.    METHOD invert () RETURNS (BOOLEAN success)
  98.      NATIVE "Transform2DMethods@xipsup";
  99.  
  100.    METHOD preconcatenate (TRANSFORM2D other)
  101.      NATIVE "Transform2DMethods@xipsup";
  102.  
  103.    METHOD concatenate (TRANSFORM2D other)
  104.      NATIVE "Transform2DMethods@xipsup";
  105.  
  106.    METHOD decompose () RETURNS (TRANSFORM2DPARTS parts)
  107.      NATIVE "Transform2DMethods@xipsup";
  108.  
  109.    METHOD determinant () RETURNS (DOUBLE value)
  110.      NATIVE "Transform2DMethods@xipsup";
  111.  
  112.    METHOD isIdentity () RETURNS (BOOLEAN value)
  113.      NATIVE "Transform2DMethods@xipsup";
  114.  
  115.    METHOD applyToWin (LIST window) RETURNS (LIST rwindow)
  116.      NATIVE "Transform2DMethods@xipsup";
  117.  
  118.    METHOD parse (STRING str) RETURNS (TRANSFORM2D t)
  119.      NATIVE "Transform2DMethods@xipsup";
  120.  
  121.    METHOD toString () RETURNS (STRING value)
  122.      NATIVE "Transform2DMethods@xipsup";
  123.  
  124.    METHOD getCoeffs () RETURNS (LIST coeffs)
  125.      NATIVE "Transform2DMethods@xipsup";
  126.  
  127.    METHOD setCoeffs (LIST coeffs)
  128.      NATIVE "Transform2DMethods@xipsup";
  129. }
  130.